package com.its.cloud.controller;

import com.its.cloud.entity.ResultBean;
import com.its.cloud.service.StorageService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @author huguangjun
 * @className StorageController
 * @date 2021/1/18
 * @desc 11:00
 */
@RestController
public class StorageController {

    @Resource
    private StorageService storageService;

    @RequestMapping("/storage/decrease")
    public ResultBean decrease(Long productId, Integer count) {
        storageService.decrease(productId, count);
        return new ResultBean("seata-storage-service扣减库存成");
    }
}
